﻿/*-------------------------------------------------------
 * 错误异常
 --------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using FL.Log;

namespace FL.Common
{
    public class ErrorException : Exception
    {
        /// <summary>
        /// 抛出的错误信息
        /// </summary>
        string _mess;
        public override string Message
        {
            get
            {
                return _mess;
            }
        }

        public ErrorException(Exception e)
        {
            FL.Log.XTrace.WriteLine("--------------------------------------------------");
            FL.Log.XTrace.WriteLine("发生时间："+System.DateTime.Now.ToString());
            FL.Log.XTrace.WriteLine(e.Message);
            FL.Log.XTrace.WriteLine("--------------------------------------------------");
            _mess = e.Message;
        }

        public ErrorException(Exception e,FL.DBModule.Sys.SysUser user)
        {
            FL.Log.XTrace.WriteLine("--------------------------------------------------");
            FL.Log.XTrace.WriteLine("发生时间：" + System.DateTime.Now.ToString());
            FL.Log.XTrace.WriteLine("当前操作者："+user.username);
            FL.Log.XTrace.WriteLine(e.Message);
            FL.Log.XTrace.WriteLine("--------------------------------------------------");
            _mess = e.Message;
        }
        public ErrorException()
        {
            
        }
    }
}
